<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	
	<body>
		<script>
			//1.数组
			var arr1 = new Array();
			console.log(arr1.length)

			arr1[0] = "张三";
			arr1[1] = 1;
			arr1[2] = "王五"
			console.log(arr1)
			console.log(arr1.length)
			var arr2 = new Array(3);
			console.log(arr2[0])

			var arr3 = new Array(10, 20, 30, 40, 50)
			console.log(arr3[0])

			var arr4 = [10, 20, 30, 40]
			console.log(arr4)
			var arr5 = [
				[1, 2, 3],
				[4, 5, 6],
				[7, 8, 9],
			]
			var stus = [{
					id: 1,
					name: "张三",
					age: 18
				},
				{
					id: 2,
					name: "李四",
					age: 19
				},
				{
					id: 3,
					name: "王五",
					age: 20
				},
			]
			console.log(stus)

			for (var i in stus) {
				var stu = stus[i]

				document.write("<table>");
				document.write("<tr>");
				document.write("<td>");
				document.write("学号");

				document.write("</td>");

				document.write("<td>");
				document.write("姓名");

				document.write("</td>");

				document.write("<td>");
				document.write("年龄");
				document.write("</td>");
				document.write("</tr>");

				for (var i in stus) {
					var stu = stus[i]
					document.write("<tr>");
					document.write("<td>");
					document.write(stu.id);

					document.write("</td>");

					document.write("<td>");
					document.write(stu.name);

					document.write("</td>");

					document.write("<td>");
					document.write(stu.age);

					document.write("</td>");
					document.write("</tr>");
				}
				document.write("</table>");
			}
		</script>
	</body>
</html>